package com.wutuo.util;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 返回给前端的Page信息(也就是查询结果用的Page)
 * <p/>
 * 标题、简要说明. <br>
 * 类详细说明.
 * <p/>
 * Copyright: Copyright (c) 2014年7月12日 下午2:39:33
 * <p/>
 * Company: 网龙公司
 * <p/>
 * @author zzf
 * @version 1.0.0
 */
public class TablePage {

    // 当前是第几页
    @JsonProperty("current_index")
    private int currentIndex;

    // 每页显示几条
    @JsonProperty("current_record")
    private int currentRecord;

    // 每页显示currentRecord条的情况下，有几页
    @JsonProperty("total_page")
    private int totalPage;

    // 总的有几条
    @JsonProperty("total_record")
    private int totalRecord;

    public TablePage() {

    }

    public TablePage(int currentIndex, int currentRecord, int totalPage, int totalRecord) {

        this.currentIndex = currentIndex;
        this.currentRecord = currentRecord;
        this.totalPage = totalPage;
        this.totalRecord = totalRecord;
    }

    public TablePage(int currentIndex, int currentRecord, long totalPage, long totalRecord) {

        this.currentIndex = currentIndex;
        this.currentRecord = currentRecord;
        this.totalPage = Integer.valueOf(String.valueOf(totalPage));
        this.totalRecord = Integer.valueOf(String.valueOf(totalRecord));
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getTotalRecord() {
        return totalRecord;
    }

    public void setTotalRecord(int totalRecord) {
        this.totalRecord = totalRecord;
    }

    public int getCurrentIndex() {
        return currentIndex;
    }

    public void setCurrentIndex(int currentIndex) {
        this.currentIndex = currentIndex;
    }

    public int getCurrentRecord() {
        return currentRecord;
    }

    public void setCurrentRecord(int currentRecord) {
        this.currentRecord = currentRecord;
    }

}
